<template>
  <div class="page-table">
    <div class="page-filter">
<!--      <div class="query">-->
<!--        <el-form size="mini">-->
<!--          <el-row :gutter="4">-->
<!--            <el-col :span="3">-->
<!--              <el-form-item>-->
<!--                <el-input v-model="searchQuery.orderNo" placeholder="订单号" clearable>-->
<!--                  <template slot="prepend">D</template>-->
<!--                </el-input>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
<!--            <el-col :span="4">-->
<!--              <el-button size="mini" type="primary" plain @click="companyGetInitList()">查询</el-button>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--        </el-form>-->
<!--      </div>-->
    </div>
    <ad-table ref="order"
              :data="orderList" :show-summary="orderSummary" v-loading="orderInitLoading" border u-table :data-changes-scroll-top="orderIsScrollTop"
              @row-click="orderSelectRow" @selection-change="orderSelectRows"
              :searchQuery="orderSearchQuery" @search="orderGetInitList"
              @sort-change="orderSortInitList" @filter-change="orderFilterInitList"
              @table-body-scroll="orderGetMoreList" :height="tableHeight">
<!--      <ad-table-column type="selection" ctype="selection" fixed/>-->
      <ad-table-column label="序号" type="index" ctype="index" fixed/>
      <ad-table-column label="订单编号" prop="orderSubNo" ctype="orderNo" searchable w="4c1f" href="/order/detail" fixed/>
      <ad-table-column label="订单状态" prop="status" dictName="order_status" filterable w="4c1f"/>
      <ad-table-column label="制单人" prop="createUserName" searchable w="4c1f" sortable/>
      <ad-table-column label="制单时间" ctype="datetime" prop="createTime" w="1f" sortable/>
      <ad-table-column label="委托方" prop="companyName" searchable w="3c1f"/>
      <ad-table-column label="联系人" prop="linkmanName" searchable w="3c1f"/>
      <ad-table-column label="联系电话" prop="linkmanPhone" searchable w="4c1f"/>
      <ad-table-column label="车辆名称" prop="carName" searchable w="4c1f"/>
      <ad-table-column label="车架号" prop="vin" ctype="vin" searchable w="4c1f"/>
      <ad-table-column label="出发地" prop="startCode" sortable ctype="city"/>
      <ad-table-column label="目的地" prop="destinationCode" sortable ctype="city"/>
      <ad-table-column label="提车方式" prop="pickType" dictName="pickcar_type" filterable w="4c1f"/>
      <ad-table-column label="送车方式" prop="takeType" dictName="takecar_type" filterable w="4c1f"/>
      <ad-table-column label="运输费" prop="transportFee" sortable w="3c1f"/>
      <ad-table-column label="提车费" prop="pickFee" sortable w="3c1f"/>
      <ad-table-column label="送车费" prop="takeFee" sortable w="3c1f"/>
      <ad-table-column label="客户返款" prop="kickbackFee" sortable w="4c1f"/>
      <ad-table-column label="保险费" prop="insuranceFee" sortable w="3c1f"/>
      <ad-table-column label="开票税额" prop="invoiceFee" sortable w="4c1f"/>
      <ad-table-column label="付款方式" prop="paymentType" dictName="payment_type" filterable w="4c1f"/>
      <ad-table-column label="订单备注" prop="remark" ctype="remark"/>
      <ad-table-column label="操作" width="70" fixed="right">
        <template v-slot="{row}">
          <div class="op">
            <el-button type="text" class="op-btn" @click="edit">修改</el-button>
          </div>
        </template>
      </ad-table-column>
    </ad-table>
  </div>
</template>

<script>
import AdTable from '@/components/AdTable'
import AdTableColumn from '@/components/AdTable/AdTableColumn'
import adTable from '@/mixins/adTable/index'
import { getList as orderApiGetList } from '@/api/order/all'

export default {
  name: 'finance-order',
  components: { AdTable, AdTableColumn },
  dicts: ['order_status','payment_type','pickcar_type','takecar_type'],
  mixins: [adTable([{name: 'order'}])],
  data() {
    return {
      searchQuery: {},
      tableHeight: document.documentElement.clientHeight - 106,
    }
  },
  created() {
    this.orderGetInitList()
  },
  methods: { orderApiGetList,
    edit() {
      setTimeout(() => {
        this.orderEdit({path: '/finance/order/edit', query: {mode: 'edit', id: this.orderSelectedRowId}})
      })
    }
  }
}
</script>